<div>
    <!-- <div>
        <h4>字段管理</h4>
        <div class="button-group">
            <button class="btn btn-default" ng-click="add()">新增</button>
            <button class="btn btn-default" ng-click="modify()" ng-disabled="!isSelected">修改</button>
            <button class="btn btn-default" ng-click="goDel()" ng-disabled="!isSelected">删除</button>
            <button class="btn btn-default" ng-click="goUp()" ng-disabled="!isSelected">上移</button>
            <button class="btn btn-default" ng-click="goDown()" ng-disabled="!isSelected">下移</button>
            <button class="btn btn-default" ng-click="goSonTemplate()">添加子模板</button>
        </div>
        <div class="rule-table">

            <table class="table table-bordered table-responsive ">
                <tr>
                    <td>规则名称</td>
                    <td>匹配模式</td>
                    <td>开头</td>
                    <td>结尾</td>
                    <td>最少标签数</td>
                    <td>模糊系数</td>
                    <td>操作</td>
                </tr>
                <tr ng-repeat="r in rules" ng-click="select(r)" ng-class="{true: 'selected', false:'unselected'}[r==selectedItem]">
                    <td>{{r.name}}</td>
                    <td>{{r.type=='1'?'匹配开头':(r.type=='2'?'匹配开头结尾':'匹配全文')}}</td>
                    <td>{{r.beginText}}</td>
                    <td>{{r.endText}}</td>
                    <td>{{r.limit}}</td>
                    <td>{{r.similar}}</td>
                    <td>
                        <div class="radio">
                            <label>
                                <input type="radio" value="keep" ng-model="r.keep">保留
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" value="filtrate" ng-model="r.keep">过滤
                            </label>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div> -->
    <div layout="row" class="rule-group-header" layout-align="end center">
      <!-- <h3>字段管理</h3> -->
      <div class="table-toolbar">
        <md-button class="toolbar-button" ng-click="add($event)">
          <md-tooltip md-direction="down">新增</md-tooltip>
          <ng-md-icon class="menu-icon" icon="add"></ng-md-icon>
        </md-button>
        <md-button class="toolbar-button" ng-click="modify($event)" ng-disabled="!isSelected">
          <md-tooltip md-direction="down">修改</md-tooltip>
          <ng-md-icon class="menu-icon" icon="create"></ng-md-icon>
        </md-button>
        <md-button class="toolbar-button" ng-click="goDel()" ng-disabled="!isSelected">
          <md-tooltip md-direction="down">删除</md-tooltip>
          <ng-md-icon class="menu-icon" icon="clear"></ng-md-icon>
        </md-button>
        <md-button class="toolbar-button" ng-click="goUp()" ng-disabled="!isSelected">
          <md-tooltip md-direction="down">上移</md-tooltip>
          <ng-md-icon class="menu-icon" icon="arrow_upwards"></ng-md-icon>
        </md-button>
        <md-button class="toolbar-button" ng-click="goDown()" ng-disabled="!isSelected">
          <md-tooltip md-direction="down">下移</md-tooltip>
          <ng-md-icon class="menu-icon" icon="arrow_downward"></ng-md-icon>
        </md-button>
      </div>
    </div>
    <md-table-container layout-padding>
      <table md-table class="rule-group">
        <tr>
          <th md-column width="10%">序号</th>
          <th md-column width="15%">名称</th>
          <th md-column width="15%">模式</th>
          <th md-column width="40%">开头</th>
          <th md-column width="20%">结尾</th>
          <!-- <th md-column>操作</th> -->
        </tr>
        <tr ng-repeat="r in rules" ng-click="select(r)" ng-class="{true: 'selected', false:'unselected'}[r==selectedItem]">
          <td>{{$index+1}}</td>
          <td>{{r.name}}</td>
          <td>{{r.type=='1'?'匹配开头':(r.type=='2'?'匹配开头结尾':'匹配全文')}}</td>
          <td>{{r.beginText | limitTo:30}}</td>
          <td>{{r.endText | limitTo:30}}</td>
          <!-- <td>{{r.limit}}</td> -->
          <!-- <td>{{r.similar}}</td> -->
          <!-- <td>
              <div class="radio">
                  <label>
                      <input type="radio" value="keep" ng-model="r.keep">保留
                  </label>
              </div>
              <div class="radio">
                  <label>
                      <input type="radio" value="filtrate" ng-model="r.keep">过滤
                  </label>
              </div>
          </td> -->
        </tr>
      </table>
    </md-table-container>
</div>
